package com.qfjy.service.impl.example3;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @ClassName WeatherServiceImpl
 * @Description TODO  天气预报分发
 * @Author guoweixin
 * @Date 2022/11/22
 * @Version 1.0
 */
@Service
@Slf4j
public class WeatherServiceImpl {

    /**
     * TODO 京东主页获取天气预报信息
     */
    @RabbitListener(queues = {"weatherFanoutJDQueue"})
    public void weatherJDMessage(Map<String,Object> map){
        String msg= (String) map.get("msg");
        String city= (String) map.get("city");
        log.info("京东商城显示天气情况是：{}+{}",msg,city);
    }


    /**
     * TODO 淘宝主页获取天气预报信息
     */
    @RabbitListener(queues = {"weatherFanoutTBQueue"})
    public void weatherTBMessage(Map<String,Object> map){
        String msg= (String) map.get("msg");
        String city= (String) map.get("city");
        log.info("淘宝商城显示天气情况是：{}+{}",msg,city);
    }
}
